﻿using System;

namespace Athena.ExceptionHandler
{
    public abstract class BaseException : Exception
    {
        public int Code { get; }

        public BaseException(int code, Exception innerException) : base(((AthenaRpcInvokeResultCodeDisplay)code).ToString(), innerException)
        {
            Code = code;
        }

        public BaseException(string message, Exception innerException) : base(message, innerException)
        {
            Code = (int)AthenaRpcInvokeResultCodeDisplay.未知系统错误;
        }

        public BaseException(AthenaRpcInvokeResultCodeDisplay AthenaRpcInvokeResultCodeDisplay, Exception innerException) : base(AthenaRpcInvokeResultCodeDisplay.ToString(), innerException)
        {
            Code = (int)AthenaRpcInvokeResultCodeDisplay;
        }

        public BaseException(int code, string message, Exception innerException) : base(message, innerException)
        {
            Code = code;
        }

        public BaseException(AthenaRpcInvokeResultCodeDisplay AthenaRpcInvokeResultCodeDisplay, string message, Exception innerException) : base(message, innerException)
        {
            Code = (int)AthenaRpcInvokeResultCodeDisplay;
        }
    }
}
